| Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCalc.Click Dim Hp As Single HP = TextBox1.Text Dim af As Single ' we need to declare the variables. "single" is a single precision floating point af = 11 Dim bsfc As Single bsfc = 0.55 Dim x As Single x = 2 Dim Wa As Single Wa = Hp * af * (bsfc / 60) Wa = Wa / x Dim q As Single Dim PR As Single q = Hp / 27.5 PR = (q + 14.7) / 13.7 Wa = FormatNumber(Wa, 1) PR = FormatNumber(PR, 1) q = FormatNumber(q, 1) MessageBox.Show("The required airflow for each turbo is " & Wa & " lbs/min" & vbCr & vbCr & _ "On the compressor map, your desired power will lie on this intersection:" & vbCr & "Pressure Ratio: " & PR & vbCr _ & "Corrected airflow: " & Wa & vbCr & vbCr & "The required boost pressure is " & q & " psi at sea level", "Results") End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnExit.Click Me.Dispose() End Sub Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged End Sub Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) End Sub Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) End Sub Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) End Sub Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) End Sub End Class
 |